{include file="header.html"}
<script type="text/javascript">
$(function(){
    $('#recom_ds_form').validate({
        errorPlacement: function(error, element){
            $(element).next('.field_notice').hide();
            $(element).after(error);
        },
        success       : function(label){
            label.addClass('right').text('OK!');
        },
        onkeyup    : false,
        rules : {
            name : {
                required : true,
            },
            logo : {
                accept  : 'gif|png|jpe?g'
            },
            sort_order : {
                number   : true
            }
        },
        messages : {
            name : {
                required : '{$lang.recom_empty}'
            },
            logo : {
                accept : '{$lang.limit_img_desc}'
            },
            sort_order  : {
                number   : '{$lang.number_only}'
            }
        }
    });
});
</script>
<div id="rightTop">
    <p>{$lang.recom_ds}</p>
    <ul class="subnav">
        <li><a class="btn1" href="index.php?app=recom_ds&amp;type=image">{$lang.image_type}</a></li>
        {if $recom_data.id}
        <li><a class="btn1" href="index.php?app=recom_ds&amp;act=add">{$lang.add_image_type}</a></li>
        {else}
        <li><span>{$lang.add_image_type}</span></li>
        {/if}
    </ul>
</div>

<div class="info">
    <form method="post" enctype="multipart/form-data" id="recom_ds_form">
        <table class="infoTable">
            <tr>
                <th class="paddingT15">
                    {$lang.image_name}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput2" id="name" type="text" name="name" value="{$recom.name|escape}" /> <label class="field_notice">{$lang.recom_name_desc}</label>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.cate_name}:</th>
                <td class="paddingT15 wordSpacing5">
                <select class="querySelect" name="cate_id">
                    <option value="">{$lang.select_pls}</option>
                    {html_options options=$rcate_data selected=$recom.cate_id}
                </select>
                <label class="field_notice">{$lang.cate_name_desc}</label>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.image_cate}:</th>
                <td class="paddingT15 wordSpacing5">
                <select class="querySelect" name="r_type">
                    <option value="">{$lang.select_pls}</option>
                    {html_options options=$type selected=$recom.r_type}
                </select>
                <label class="field_notice">{$lang.recom_type_desc}</label>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.gcategory_name}:</th>
                <td class="paddingT15 wordSpacing5">
                <select class="querySelect" name="gcategory_id">
                    <option value="">{$lang.select_pls}</option>
                    {html_options options=$gcategory_data selected=$recom.gcategory_id}
                </select>
                <label class="field_notice">{$lang.gcategory_name_desc}</label>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.logo}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableFile2" id="recom_logo" type="file" name="logo" />
                    <label class="field_notice">{$lang.limit_img_desc}</label>
                </td>
            </tr>
            {if $recom.logo}
            <tr>
                <th class="paddingT15">
                </th>
                <td class="paddingT15 wordSpacing5">
                <img src="{$recom.logo}" class="makesmall" max_width="120" max_height="90" />
                </td>
            </tr>
            {/if}
            <tr>
                <th class="paddingT15">
                    {$lang.recom_url}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput2" id="url" type="text" name="url" value="{$recom.url|escape}" /> <label class="field_notice">{$lang.recom_url_desc}</label>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.if_show}:</th>
                <td class="paddingT15 wordSpacing5">
                {html_radios options=$yes_or_no checked=$recom.if_show name=if_show}
                <label class="field_notice">{$lang.if_show_desc}</label>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.sort_order}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="sort_order" id="sort_order" type="text" name="sort_order" value="{$recom.sort_order}" />
                    <label class="field_notice">{$lang.update_order}</label>
                </td>
            </tr>
        <tr>
            <th></th>
            <td class="ptb20">
                <input class="formbtn" type="submit" name="Submit" value="{$lang.submit}" />
                <input class="formbtn" type="reset" name="Submit2" value="{$lang.reset}" />
            </td>
        </tr>
        </table>
    </form>
</div>
{include file="footer.html"}
